export function translateListToTreeData(list, rootValue) {
  const arr = []
  list.forEach(item => {
    if (item.pid === rootValue) {
      arr.push(item)
      const children = translateListToTreeData(list, item.id)
      if (children.length) { item.children = children } // 将子节点赋值给当前节点
    }
  })
  return arr
}
